#ifndef ELIBC_LIST_H
#define ELIBC_LIST_H

#include "linked_list.h"

typedef LinkedListIterator ListIterator;
typedef LinkedList List;

// ListIterator {

void * listIteratorData(const ListIterator * iterator);

ListIterator * listIteratorPrev(const ListIterator * iterator);

ListIterator * listIteratorNext(const ListIterator * iterator);

// }

// List {

List * listNew(FunctionEqualTo equalTo, FunctionOnInserted onInserted, FunctionOnErased onErased);

void listDelete(List * list);

ListIterator * listBegin(const List * list);

ListIterator * listEnd(const List * list);

int listIsEmpty(const List * list);

void listClear(List * list);

ListIterator * listInsert(List * list, ListIterator * position, const void * data);

ListIterator * listErase(List * list, ListIterator * position);

ListIterator * listFind(const List * list, const void * data);

ListIterator * listFindIn(const List * list, const ListIterator * first, const ListIterator * last, const void * data);

ListIterator * listFindIf(const List * list, const void * key, FunctionEqualTo equalTo);

ListIterator * listFindInIf(const List * list, const ListIterator * first, const ListIterator * last, const void * key, FunctionEqualTo equalTo);

void listSplice(const List * list, ListIterator * position, const List * another);

void listSpliceAt(const List * list, ListIterator * position, const List * another, ListIterator * iterator);

void listSpliceIn(const List * list, ListIterator * position, const List * another, ListIterator * first, ListIterator * last);

void listTransfer(const List * list, ListIterator * position, const List * another, ListIterator * first, ListIterator * last);

void listMarge(const List * list, const List * another);

// }

// ListForInt {

List * listForIntNew();

ListIterator * listForIntInsert(List * list, ListIterator * position, int data);

ListIterator * listForIntFind(const List * list, int data);

ListIterator * listForIntFindIn(const List * list, const ListIterator * first, const ListIterator * last, int data);

// }

// ListForUInt {

List * listForUIntNew();

ListIterator * listForUIntInsert(List * list, ListIterator * position, unsigned int data);

ListIterator * listForUIntFind(const List * list, unsigned int data);

ListIterator * listForUIntFindIn(const List * list, const ListIterator * first, const ListIterator * last, unsigned int data);

// }

#endif // ELIBC_LIST_H
